﻿@model Kooboo.CMS.Web.Areas.Sites.Models.ImportSiteModel
@{
    ViewBag.Title = "Import site".Localize();
    Layout = "~/Views/Shared/Blank.cshtml";
}
@section Panel{
    <ul class="panel">
        <li>
            <a data-ajaxform="">
                @Html.IconImage("save") @("Save".Localize())</a>
        </li>
        @foreach (var group in Kooboo.CMS.Sites.Extension.UI.TopToolbar.ToolbarButtons.GetToolbarButtons(ViewContext.RequestContext))
        {
            @Html.Partial("_ToolbarGroupButtons", group)
        }
        <li>
            <a href="@ViewContext.RequestContext.GetRequestValue("return")">
                @Html.IconImage("cancel") @("Back".Localize())</a>
        </li>
    </ul>
}
<div class="block common-form">
    <h1 class="title">@ViewBag.Title</h1>
    @using (Html.BeginForm())
    { 
        @Html.ValidationSummary(true) 
    
        <table>
            @Html.EditorFor(o => o.Name, new { HtmlAttributes = new { @class = "medium" } })
            @Html.EditorFor(o => o.File)
            @Html.EditorFor(o => o.KeepSiteSetting)
            @Html.EditorFor(o => o.Parent, new { HtmlAttributes = new { @class = "medium" } })
            @Html.EditorFor(o => o.Repository, new { HtmlAttributes = new { @class = "medium" } })
            @Html.EditorFor(o => o.Membership, new { HtmlAttributes = new { @class = "medium" } })
        </table>     
    }
</div>

<script>
    $(function () {
        var trRepository = $('#Repository').parent().parent().parent();
        var trMembership = trRepository.next();       
        $('#KeepSiteSetting').change(function () {
            var keepSetting = $(this);

            if (!keepSetting.is(':checked')) {
                trRepository.show();
                trMembership.show();
            }
            else {
                trRepository.hide();
                trMembership.hide();
            }
        });

        $('#KeepSiteSetting').trigger('change');
    });
</script>
